//asynv 异步 await 等待
async function testSync(){
  const response=await new Promise(resolve =>{
    setTimeout(()=>{
      resolve("async awiat test");
    },1000);
  });
}
testSync();

async function asyncAwaitFn(str){
  return await new Promise ((resolve,reject)=>{
    setTimeout(()=>{resolve(str)},
  1000);
});
}

const serialFn=async()=>{
  console.time("serialFn")
  console.log(await asyncAwaitFn("string 1"));
  console.log(await asyncAwaitFn("string 2"));
  console.timeEnd('serialFn')
}

serialFn();
